.wrapper {
  max-width: 1280px;
  padding: 0 15px;
  display: grid;
  grid-template-columns: 300px 3fr minmax(250px, 1fr);
  grid-template-areas: 'gallery text buy';
  gap: 40px;
  margin: auto;
}

.wrapper h2 {
  margin-bottom: 10px;
}

.galleryWrapper {
  grid-area: gallery;

  display: grid;
  gap: 20px;
  justify-items: center;
  grid-template-columns: none;
  grid-template-rows: 350px max-content;
  min-height: 0;
  flex-grow: 1;
}

.galleryMainImg {
  min-height: 0;
  height: 100%;
  width: 100%;
  max-width: 100%;
  object-fit: contain;
}

.galleryMainImg:hover {
  cursor: pointer;
  transform: scale(1.2, 1.2);
  transition: transform 0.2s;
}

.galleryThumbnails {
  height: 100%;
  width: 100%;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-gutter: stable;
  padding: 10px;
  line-height: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, 100px);
  gap: 5px;
  justify-content: center;
  scrollbar-gutter: auto;
}

.galleryThumbnails img {
  height: 100px;
  width: 100%;
  object-fit: contain;
  border: 2px solid rgb(151, 151, 151);
  background: white;
}

.text {
  grid-area: text;
}

.checkout {
  grid-area: buy;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.variants img {
  width: 150px;
  height: auto;
  object-fit: contain;
  border-radius: 10px;
  border: 2px solid white;
}

.variants img:hover {
  border: 2px solid saddlebrown;
  cursor: pointer;
}

.variants {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

img.highlighted {
  border: 2px solid saddlebrown;
}

@media (width <= 1000px) {
  .wrapper {
    grid-template-columns: 1fr 1fr;
    grid-template-areas: 'gallery text' 'buy buy';
  }

  .checkout {
    text-align: center;
  }
}

@media (width <= 600px) {
  .wrapper {
    grid-template-columns: 1fr;
    grid-template-areas: 'gallery' 'text' 'buy';
  }
}
